<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <form name="f1" action="http://www.bing.com" target="_blank">
      <input type="text" />
      <button type="submit">BING</button>
    </form>
    <script>
      const form = document.f1;
      form.onsubmit = function (e) {
        e.preventDefault();
      };

      setTimeout(() => {
        // 直接跳转无法拦截
        // form.submit();
      }, 3000);
    </script>
  </body>
</html>
